package com.kj2l2.common.util;

import java.sql.SQLException;
import java.sql.Connection;
//import java.sql.ResultSet;
//import java.sql.PreparedStatement;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

public class ConnUtil{
	public static Connection getConnection() throws SQLException, NamingException, ClassNotFoundException{
		Context initCtx = new InitialContext();
		Context envCtx = (Context) initCtx.lookup("java:comp/env");
		DataSource ds = (DataSource) envCtx.lookup("jdbc/myoracle");
		Connection conn = ds.getConnection();
		return conn;
	}
}
